package com.firefly.mobile.app.util;


public class StringConvertUtils {

	public static int parseInt(String str) {
		if (StringUtils.isEmpty(str)) {
			throw new RuntimeException("传入参数为空");
		}
		try {
			return Integer.parseInt(str);
			
		} catch (Exception e) {
			throw new RuntimeException("传入参数异常");
		}
	}
	public static long parseLong(String str) {
		if (StringUtils.isEmpty(str)) {
			throw new RuntimeException("传入参数为空");
		}
		try {
			return Long.parseLong(str);
			
		} catch (Exception e) {
			throw new RuntimeException("传入参数异常");
		}
	}
	public static float parseFloat(String str) {
		if (StringUtils.isEmpty(str)) {
			throw new RuntimeException("传入参数为空");
		}
		try {
			return Float.parseFloat(str);
			
		} catch (Exception e) {
			throw new RuntimeException("传入参数异常");
		}
	}
	public static boolean parseBoolean(String str) {
		if (StringUtils.isEmpty(str)) {
			throw new RuntimeException("传入参数为空");
		}
		try {
			return Boolean.parseBoolean(str);
		} catch (Exception e) {
			throw new RuntimeException("传入参数异常");
		}
	}


}
